package cn.jianyongjie.feignclient;
import cn.jianyongjie.domain.User;
import cn.jianyongjie.fallback.UserFallbackFactory;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.cloud.openfeign.FeignClient;

/**
* @Description: TODO
* @Author: JianYongJie
* @Version: 1.0
* @Date:  2022/5/31 10:00
*/
//@FeignClient(value = "user-server",fallback = UserFeignFallback.class)
@FeignClient(value = "user-server",fallbackFactory = UserFallbackFactory.class)
public interface UserFeignClient {

    //Feign的客户端接口是用来调用微服务的
    @GetMapping("/userById/{id}")
    User userById(@PathVariable("id") Long id);
}
